package com.meisupic.copyright.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.meisupic.copyright.common.AuthProcessEnum;
import com.meisupic.copyright.validategroups.EnterpriseAuthGroup;
import com.meisupic.copyright.validategroups.PersonAuthGroup;
import java.io.Serializable;
import java.util.Date;
import javax.validation.constraints.Future;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * creation wuxun
 * @version V1.0
 * @Description: 实名认证vo
 * @date 2018/1/13 22:54
 */
@Data
public class RealNameAuthVo implements Serializable {

  private static final long serialVersionUID = 6954289068456036105L;

  private Long id;

  /**
   * 企业或个人名称.
   */
  @NotBlank(message = "名称不能为空", groups = {PersonAuthGroup.class, EnterpriseAuthGroup.class})
  private String authName;

  /**
   * 认证类型
   */
  @NotBlank(message = "认证类型不能为空", groups = {PersonAuthGroup.class, EnterpriseAuthGroup.class})
  private String authType;


  /**
   * 证件类型.
   */
  @NotNull(message = "证件类型不能为空", groups = {PersonAuthGroup.class, EnterpriseAuthGroup.class})
  private Integer documentType;

  /**
   * 证件号码.
   */
  @NotEmpty(message = "请输入证件号码", groups = {PersonAuthGroup.class, EnterpriseAuthGroup.class})
  private String documetNo;

  /**
   * 证件是否长期有效
   */
  private Integer longTermEffective;

  /**
   * 失效日期
   */
  @Future(message = "证件有效期必须大于当前时间", groups = {PersonAuthGroup.class, EnterpriseAuthGroup.class})
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
  private Date invalidDate;

  /**
   * 证件照片正面图片地址
   */
  @NotEmpty(message = "请上传证件照片", groups = {PersonAuthGroup.class, EnterpriseAuthGroup.class})
  private String documentImgPositive;

  /**
   * 证件反面照片
   */
  @NotEmpty(message = "请上传身份证反面照片", groups = {PersonAuthGroup.class})
  private String documentImgBack;

  /**
   * 手机号码.
   */
  @Pattern(regexp = "^1(3|4|5|7|8)\\d{9}$", groups = {PersonAuthGroup.class,
      EnterpriseAuthGroup.class}, message = "请输入正确的手机号码")
  private String mobile;

  /**
   * 邮箱.
   */
  @Email(message = "请输入正确的邮箱地址")
  private String email;

  private String province;

  private String city;

  private String address;

  /**
   * 法人姓名
   */
  @NotBlank(message = "请输入法人姓名")
  private String legalName;

  /**
   * 法人身份号码.
   */
  private String legalIdentityCardNo;

  /**
   * 法人身份证正面照片.
   */
  private String corporateIdentityCardImgPositive;

  /**
   * 法人身份证反面照片.
   */
  private String corporateIdentityCardImgBack;

  /**
   * 审核状态
   */
  private AuthProcessEnum auditStatus;

  private Integer version;

  private Long creatorId;

  private Long modifierId;

  public void setInvalidDate(Date invalidDate) {
    this.invalidDate = invalidDate;
  }
}
